<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Message extends Model
{
    protected $table = 'messages';

    protected $fillable = [
    	'wechat_user_id',
    	'wechat_doctor_info_id',
    	'content'
    ];

    public function wechatUser(){
    	return $this->belongsTo('App\Models\WeChatUser', 'wechat_user_id');
    }

    public function weChatDoctorInfo(){
    	return $this->belongsTo('App\Models\WeChatDoctorInfo', 'wechat_doctor_info_id');
    }

    public function replys(){
        return $this->hasMany('App\Models\Reply', 'message_id');
    }
}
